package router

import (
	"github.com/gin-gonic/gin"

	"mxshop-api/order-web/api/trade"
	"mxshop-api/order-web/global"
	"mxshop-api/shared/auth"
)

func InitTransRouter(router *gin.RouterGroup) {
	signingKey := global.ServerConfig.SigningKey
	PaymentRouter := router.Group("/trade")
	{
		PaymentRouter.POST("/payment", auth.Middleware(signingKey), trade.Payment)   // 支付
		PaymentRouter.POST("/alipay/notify", trade.Notification)                     // 支付宝授权回调地址
		PaymentRouter.GET("/query/:id", auth.Middleware(signingKey), trade.GetTrade) // 查询支付宝订单信息
	}
}
